package task_system;

import java.util.ArrayList;

public class TaskSystem {
	private int n; //number of tasks of the system
	ArrayList<Task> tasks = new ArrayList<Task>();
	
	public TaskSystem(ArrayList<int[]> tasks){
		this.n = tasks.size();
		this.constructSystem(tasks);
	}
	
	private void constructSystem(ArrayList<int[]> tasks){
		for(int[] task : tasks){
			this.tasks.add(new Task(task[0], task[1], task[2]));
		}
	}
		
	public int n(){
		return n;
	}
	
	public ArrayList<Task> tasks(){
		return tasks;
	}
	
	public String toString(){
		String result = "";
		for(Task t : this.tasks()){
			result += t.toString() + "\n";
		}
		return result;
	}
	
}